<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        div,
        img {
            margin: 0;
            padding: 0;
        }

        .container {
            display: flex;
            justify-content: center;
            align-items: center;
            width: 400px;
            margin: 0 auto;
            background-color: #333;
          
        }

        .pictureList {
            display: flex;
            flex-wrap: nowrap;
            justify-content: center;
            height: 150px;
            width: 300px;
            overflow: hidden;

        }

        .pictureList img {
            display: flex;
            flex-shrink: 0;
            width: 300px;
            height: 150px;
        }

        .options {
            display: flex;
            justify-content: space-between;
            width: 300px;
            font-size: 12px;
            color: yellow;
        }
        
        .option:hover
        {
            background-color: aliceblue;
            color: blue;
            cursor: pointer;
        }


    </style>
</head>

<body>

    <div class="container">
        <div>
            <div class="pictureList">
            </div>
            <div class="options">
            </div>
        </div>
    </div>

    <script>
        let images = [
            './000，imgine/01.jpg',
            './000，imgine/02.jpg',
            './000，imgine/03.jpg',
            './000，imgine/04.jpg',
            './000，imgine/05.jpg'
        ]

        let options = [
            "风景图片1",
            "风景图片2",
            "风景图片3",
            "风景图片4",
            "风景图片5",
        ]

        const pictureList = document.querySelector('.pictureList');
        console.log(pictureList);
        for (let i = 0; i < images.length; i++) {
            const img = document.createElement('img');
            img.src = images[i];
            img.className = 'picture';
            pictureList.appendChild(img);
        }

        const spanEls = document.querySelector(".options");
        const pictures = document.querySelectorAll('.picture');
        for (let i = 0; i < options.length; i++) {
            const span = document.createElement('span');
            span.textContent = options[i];
            spanEls.appendChild(span);
            span.className = 'option';
            span.onclick = ()=>{
               pictureList.style.transform = `translateX(${i*(-300)}px)`
            } 
        }

       
    </script>
</body>

</html>